let qSort=function(list){
    let len=list.length
    if(len===0){
        return []
    }
    if(len==1){
        return list
    }
    let lesser=[]
    let greater=[]
    let mid=list[0]
    for(let i=1;i<len;i++){
        if(list[i]<mid){
            lesser.push(list[i])
        }else{
            greater.push(list[i])
        }
    }
    return qSort(lesser).concat(mid,qSort(greater))
}
// 快排
res=qSort([2,1,34,5,6,89,45,23,12,1,23,4,5,3,22,55,232,2,334,56,78,9,1,23])
console.log(res)